<?php

// +----------------------------------------------------------------------
// | MyCentOS
// +----------------------------------------------------------------------
// | Copyright (c) 2014 http://www.mycentos.com, All rights reserved.
// +----------------------------------------------------------------------
// | Author: 琥珀 <317559272@qqq.com><http://www.mycentos.com>
// +----------------------------------------------------------------------
// | @date  : 2015-04-20 17:08:01
// +----------------------------------------------------------------------
// | @Last Modified by:  琥珀
// +----------------------------------------------------------------------
// | @Last Modified time: 2015-04-27 15:38:51
// +-----------------------------------------------------------------------

namespace Home\Controller;
use Think\Controller;
class ArticleController extends Controller
{
    public function index() {

        //获取文章
        $id = I('id');
        if (!is_numeric($id)) {
            $this->error('参数错误!!', U('Index/index'));
        }
        $article = M('Article')->where(array('id' => $id))->find();
        //位置
        $position = get_now($article['category_id']);
        $this->assign('position',$position);

        $this->assign('article', $article);
        $this->display();
    }
}
